import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'


const urlConfig = {
  // 发送短信链接 1
  '法人签署认证短信邀请链接发送': { url: '/signAuth/sendSignAuthSMS', method: 'post' },// parentId
  // 获取签署合同及其他信息 2
  '获取法人认证详情': { url: '/signAuth/getAuthDetail', method: 'get' },// id= signAuthId
  // 获取人脸验证的url 3
  '获取个人刷脸认证url': { url: '/signAuth/getFaceAuthUrl', method: 'get' },// parentId

  '企业详情查询': { url: '/ent/info/queryEntDetail', method: 'get' },// parentId
  '查询企业信息及个税申报详情': { url: '/taxDeclarationEnt/getDetail', method: 'get' },// parentId

  '发送短信验证码': { url: '/zx/sys/sendSmsCode', method: 'get' },// phone
  '检测短信验证码': { url: '/zx/sys/checkSmsCode', method: 'get' },// code   phone
  '法人认证确认': { url: '/signAuth/doSignAuth', method: 'post' },// code   phone

  // 用户身份校验  单点接口
  '无密码登录接口': { url: '/zx/sys/loginbyticket', method: 'post' },// parentId
  // 发送短信链接 1
  '法人签署认证短信邀请链接发送(新)': { url: '/taxDeclarationInd/sendSMS', method: 'get' },// parentId
  // 获取邀请企业法人签署链接 手动签
  '获取邀请企业法人签署链接': { url: '/signAuth/getEntSignShortUrl4SSQ', method: 'get' },// id => 认证id smsId  type  1人脸 2短信

  '获取个人刷脸认证url': { url: '/signAuth/getFaceAuthUrl', method: 'get' },// id => 认证id smsId
  // 获取手机验证码
  '法人认证发送短信验证码': { url: '/signAuth/sendSmsCode', method: 'get' },//  phone => 用于收取验证码的手机号
  // 校验验证码
  '法人认证短信校验及回调': { url: '/signAuth/signAuthSMSCallback', method: 'get' },//  phone => 用于收取验证码的手机号 code =》 需要校验的验证码    id =》  认证id smsId
  '获取发票领用详情': { url: '/billSegment/getBillSegmentRecord', method: 'get' },//  phone => 用于收取验证码的手机号 code =》 需要校验的验证码    id =》  认证id smsId

  // 业务数据接口

  // 查账征收  178
  '查询企业信息及个税申报详情': { url: '/taxDeclarationEnt/getDetail', method: 'get' },//  id => smsbizNo
  '本季度申报总额': { url: '/taxDeclarationEnt/getInvoiceMessage', method: 'get' },//  id => smsbizNo
  '客户确认未开票收入': { url: '/taxDeclarationEnt/confirmingUnbilledRevenue', method: 'post' },//
  // 核定征收 177
  '查询企业信息及个税申报详情177': { url: '/taxDeclarationInd/getDetail', method: 'get' },//  id => smsbizNo
  '本季度申报总额177': { url: '/taxDeclarationInd/getInvoiceMessage', method: 'get' },//  id => smsbizNo
  '客户确认未开票收入177': { url: '/taxDeclarationInd/confirmingUnbilledRevenue', method: 'post' },//

  '预计上季度开票费用': { url: '/taxInvoice/calPreQuar', method: 'post' },//
  '变更税务申报合同模板图片属性': { url: '/signAuth/updateAgree4DOC_2324', method: 'post' },//
  '发票待结算撤销-H5页面发票信息': { url: '/taxInvoiceCheck/getInvoiceByCatalogName', method: 'get' },//
  '发票待结算撤销-拒绝': { url: '/taxInvoiceCheck/taxSettleRevokedReject', method: 'get' },//
  '获取个人刷脸认证url(catalogName)': { url: '/signAuth/getPersonFaceAuthUrl', method: 'get' },//
  '短信核验(catalogName)': { url: '/signAuth/signAuthCatalogSMSCallback', method: 'get' },//


}

const actionType = {
  get: (url, parameter) => {
    return getAction(url, parameter)
  },
  post: (url, parameter) => {
    return postAction(url, parameter)
  },
  put: (url, parameter) => {
    return putAction(url, parameter)
  },
  delete: (...args) => {
    return deleteAction(...args)
  },
  http: (url, parameter, method) => {
    return httpAction(url, parameter, method)
  },
}

export default (key, ...args) => {
  const tempConfig = urlConfig[key]
  return actionType[tempConfig.method](tempConfig.url, ...args)
}

